-- this is a temporary fix, it will need to be changed
local hidden_temple = 0

defineTile('.', "GRASS")
defineTile('#', {"TREE1","TREE2","TREE3","TREE4","TREE5","TREE6","TREE7","TREE8","TREE9","TREE10","TREE11","TREE12","TREE13","TREE14","TREE15","TREE16","TREE17","TREE18","TREE19","TREE20",})
quickEntity('o', {name='a strange indentation', display='T', color=colors.UMBER, image="terrain/grass.png", add_displays = {mod.class.Grid.new{image="terrain/portal_dead1.png", dislpay_on_seen=true, display_on_remember=true}}})

quickEntity('W', {show_tooltip=true, name='Water Portal', display='>', color=colors.BLUE, change_level=1, change_zone="temple-water", image="terrain/grass.png", add_displays = {mod.class.Grid.new{image="terrain/portal_alpha1.png", dislpay_on_seen=true, display_on_remember=true}}})
quickEntity('A', {show_tooltip=true, name='Air Portal', display='>', color=colors.YELLOW, change_level=1, change_zone="temple-air", image="terrain/grass.png", add_displays = {mod.class.Grid.new{image="terrain/portal_alpha1.png", dislpay_on_seen=true, display_on_remember=true}}})
quickEntity('F', {show_tooltip=true, name='Fire Portal', display='>', color=colors.RED, change_level=1, change_zone="temple-fire", image="terrain/grass.png", add_displays = {mod.class.Grid.new{image="terrain/portal_alpha1.png", dislpay_on_seen=true, display_on_remember=true}}})
quickEntity('E', {show_tooltip=true, name='Earth Portal', display='>', color=colors.UMBER, change_level=1, change_zone="temple-earth", image="terrain/grass.png", add_displays = {mod.class.Grid.new{image="terrain/portal_alpha1.png", dislpay_on_seen=true, display_on_remember=true}}})

-- not sure if this would work as the level is saved... but here it is anyway.
if hidden_temple == 1 then
	quickEntity('M', {show_tooltip=true, name='Mana portal', display='>', color=colors.VIOLET, --[[change_level=1, change_zone="temple-mana",]] image="terrain/grass.png", add_displays = {mod.class.Grid.new{image="terrain/portal_alpha.png", dislpay_on_seen=true, display_on_remember=true}}})
elseif hidden_temple == 2 then
	quickEntity('M', {show_tooltip=true, name='Chaos portal', display='>', color=colors.VIOLET, --[[change_level=1, change_zone="temple-chaos",]] image="terrain/grass.png", add_displays = {mod.class.Grid.new{image="terrain/portal_alpha.png", dislpay_on_seen=true, display_on_remember=true}}})
else
	quickEntity('M', {show_tooltip=true, name='dead portal', display='>', color=colors.SLATE, image="terrain/grass.png", add_displays = {mod.class.Grid.new{image="terrain/portal_dead.png", dislpay_on_seen=true, display_on_remember=true}}})
end

-- the top and bottom squares, no stairs, just rooms
local p = subGenerator{	--	top
	x = 13, y = 0, w = 25, h = 13,
	generator = "engine.generator.map.Roomer",
	data = {
		nb_rooms = 2,
		rooms = {"forest_clearing"},
		['.'] = "GRASS",
		['#'] = {"TREE1","TREE2","TREE3","TREE4","TREE5","TREE6","TREE7","TREE8","TREE9","TREE10","TREE11","TREE12","TREE13","TREE14","TREE15","TREE16","TREE17","TREE18","TREE19","TREE20",},
		door = "GRASS",
		force_tunnels = {
			{"random", {16, 12}, id=-1},
		},
	},
}
local q = subGenerator{	--	bottom
	x = 13, y = 38, w = 25, h = 12,
	generator = "engine.generator.map.Roomer",
	data = {
		nb_rooms = 2,
		rooms = {"forest_clearing"},
		['.'] = "GRASS",
		['#'] = {"TREE1","TREE2","TREE3","TREE4","TREE5","TREE6","TREE7","TREE8","TREE9","TREE10","TREE11","TREE12","TREE13","TREE14","TREE15","TREE16","TREE17","TREE18","TREE19","TREE20",},
		door = "GRASS",
		force_tunnels = {
			{"random", {9, 0}, id=-2},
			{"random", {17, 0}, id=-3},
		},
	},
}

-- the sides
local r = subGenerator{	--	left, has down
	x = 0, y = 0, w = 13, h = 50,
	generator = "engine.generator.map.Roomer",
	data = {
		nb_rooms = 3,
		edge_entrances = {6,4},
		rooms = {"forest_clearing"},
		['.'] = "GRASS",
		['#'] = {"TREE1","TREE2","TREE3","TREE4","TREE5","TREE6","TREE7","TREE8","TREE9","TREE10","TREE11","TREE12","TREE13","TREE14","TREE15","TREE16","TREE17","TREE18","TREE19","TREE20",},
		down = "DOWN",
		door = "GRASS",
		force_tunnels = {
			{"random", {12, 23}, id=-4},
		},
	},
	define_down = true,
}
local s = subGenerator{	--	right, has up
	x = 38, y = 0, w = 13, h = 50,
	generator = "engine.generator.map.Roomer",
	data = {
		nb_rooms = 3,
		edge_entrances = {6,4},
		rooms = {"forest_clearing"},
		['.'] = "GRASS",
		['#'] = {"TREE1","TREE2","TREE3","TREE4","TREE5","TREE6","TREE7","TREE8","TREE9","TREE10","TREE11","TREE12","TREE13","TREE14","TREE15","TREE16","TREE17","TREE18","TREE19","TREE20",},
		up = "UP",
		door = "GRASS",
		force_tunnels = {
			{"random", {0, 30}, id=-5},
		},
	},
	define_up = true,
}

checkConnectivity({26,26}, "entrance", "boss-area", "exit")

--[[        1         2         3         4
  01234567890123456789012345678901234567890123456789]]
return {                                              
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[             ################.########            ]],
[[             ##.#############..####.##            ]],
[[             #.F.##########.....##.E.#            ]],
[[             #....########......#....#            ]],
[[             ##...########......#...##            ]],
[[             ###..#########....##..###            ]],
[[             ####..#########..##..####            ]],
[[             #####..#######..##..#####            ]],
[[             ######..#####..##..######            ]],
[[             ##...##..###..##..#######            ]],
[[             #.....##..##.##..########            ]],
[[             .......##..o.o..####...##            ]],
[[             #...........M.........###            ]],
[[             ##.....##..o.o..##...####            ]],
[[             ########..##+##..##....##            ]],
[[             #######..##...##..##..###            ]],
[[             ######..##.....##..##.##.            ]],
[[             #####..####...####..##..#            ]],
[[             ####..####..#..####..####            ]],
[[             ###..###...###.#####..###            ]],
[[             ##...##....###..####...##            ]],
[[             #....##.....###..###....#            ]],
[[             #.A.###.#...####.####.W.#            ]],
[[             ##.#####...#####..####.##            ]],
[[             #########.########.######            ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]],
[[                                                  ]]
}
